const key: 'loginInfo' = 'loginInfo';


export const get =() => {
  try {
    return JSON.parse(localStorage.getItem(key) as any);
  } catch (error) {
    return localStorage.getItem(key);
  }
};


export const set = <T>(value: T) => {
  if (value instanceof Object) {
    localStorage.setItem(key, JSON.stringify(value));
  } else {
    localStorage.setItem(key, value as string);
  }
};


export const remove = () => {
  localStorage.removeItem(key);
};